<?php 
/**
* 
*/
class Lianxi extends Father01
{	
	public $name="小明";
	public $sex="男";
	
	function run()
	{
		echo $this->name;
		echo "<br>";
		echo $this->name="小王";
		echo "<br>";
		echo $this->name;
	}

	function suiji($nums=16)
	{
		 echo $this->suiji01($nums);
		 echo "<br>";

	}
	function suiji01($num)
	{
		$kong="";
		$str="abcdefghijklmnopk";
		for ($i=1; $i <= $num; $i++) { 
			$a=rand(0,16);
			$kong=$kong.$str[$a];
		}
		return $kong;
		
	}

	
	function __construct($n="")
	{
		echo $this->name=empty($n)? $this->name:$n;
		// 三元表达式：如果参数$n为空，（修改参数$n在调用类的时候在类名后面改）这个类的成员name就等于这个类的成员name，否则这个类的成员name等于$n
		echo "<br>";
	}
	









}









 ?>